<?php
namespace app\admin\controller;

use think\Controller;
use think\Request;

class Index extends BaseController
{

    public function index()
    {
        return  view();
    }
    public function addUser()
    {
        var_dump($this->request);
        if(!$this->checkRule("admin/index/addUser",session("id")))
        {
            echo "你虽然登录了，但没有此操作权限";
        }
        else
        {
            echo "有权限";
        }
    }
    protected function checkRule($url,$id)
    {
        $model = model("Rule");
        $res = $model->where(["url"=>$url,"users_id"=>$id])->find();
        return !empty($res);
    }
    public function deleteUser($id)
    {

    }
    public function save($id)
    {

    }
}
